package com.example.hibernate.e.inheritance_1;

import javax.persistence.AttributeOverride;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

@Entity
@Table(name="T_CREDITCARD")
@AttributeOverride(name="owner", column=@Column(name="CC_OWNER", nullable=false))
@SequenceGenerator(name="SEQ_CREDITCARD", sequenceName="SEQ_CREDITCARD", initialValue=1)
public class CreditCard extends BillingDetails {
	
	@Id
	@GeneratedValue(generator="SEQ_CREDITCARD")
	@Column(name="CREDITCARD_ID")
	private Long id;
	
	@Column(name="CREDITCARD_NUMBER")
	private String number;
	
	@Column(name="CREDITCARD_EXPMONTH")
	private String expMonth;
	
	@Column(name="CREDITCARD_EXPYEAR")
	private String expYear;

	public Long getId() {
		return id;
	}

	private void setId(Long id) {
		this.id = id;
	}

	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public String getExpMonth() {
		return expMonth;
	}

	public void setExpMonth(String expMonth) {
		this.expMonth = expMonth;
	}

	public String getExpYear() {
		return expYear;
	}

	public void setExpYear(String expYear) {
		this.expYear = expYear;
	}

	@Override
	public String toString() {
		return "CreditCard [id=" + id + ", number=" + number + ", expMonth=" + expMonth + ", expYear=" + expYear + "]";
	}
	
}
